package com.onewo.arthasdemo.service;

import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class EchoService {

    public String echo(String e) throws InterruptedException {
        System.out.println(" input  "+e);
        return echo0(e);
    }

    public String echo0(String e) throws InterruptedException {
        Thread.sleep(new Random().nextInt(5)*500);
        return echo1(e);
    }


    public String echo1(String e) throws InterruptedException {
        Thread.sleep(new Random().nextInt(5)*500);
        return echo2(e);
    }


    public String echo2(String e) throws InterruptedException {
        Thread.sleep(new Random().nextInt(5)*500);
        return echo3(e);
    }



    public String echo3(String e) throws InterruptedException {
        Thread.sleep(new Random().nextInt(5)*500);
        return echo4(e);
    }



    public String echo4(String e) throws InterruptedException {
        Thread.sleep(new Random().nextInt(5)*500);
        return e;
    }


    public void increase() {
        //todo db里面增加1

    }
}
